package common.tree;

import java.util.List;
import java.util.Map;
import java.util.function.Predicate;

/**
 * @author ：Sei
 * @date ：Created in 2020/1/6 12:57
 * @description：树接口
 * @modified By：
 * @version: $
 */
public interface ITree<K, N extends ITreeNode<K, N>> {
    Map<K, List<N>> mapByNodes();

    Map<K, N> mapByNodesSelf();

    List<N> findUp(N node, Predicate<N> searcher);

    N findUpFirst(N node, Predicate<N> searcher);

    List<N> findDown(N node, Predicate<N> searcher);

    N findDownFirst(N node, Predicate<N> searcher);

    List<N> getParentsNode(N node);

    List<N> getSubNode(N node);

    List<N> getSubLeaf(N node);

    N getParent(N node);

    List<N> getChildren(N node);
}
